package AccionBoton;

import java.awt.AWTEvent;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent;

import util.Barrido;

public class AccionClickRaton implements AWTEventListener{
	
	private Barrido _barrido;
	
	public AccionClickRaton(Barrido barrido){
		_barrido = barrido;
	}

	 public void eventDispatched(AWTEvent evt) {
		 if (evt.getID() == MouseEvent.MOUSE_CLICKED) {
			 if( ((MouseEvent) evt).getButton()==MouseEvent.BUTTON1){
				 _barrido.eventoRaton(false);
			 }			 
			 if( ((MouseEvent) evt).getButton()==MouseEvent.BUTTON3){
				 _barrido.eventoRaton(true);
			 }
			
		 }
	 }
	
}
